package com.homwee.tvap.common.comSettingInterface;

import android.content.Context;
import android.util.Log;

//zcj 2018-10-30 import com.changhong.android.tvapi.common.vo.ChOsType.EnumPanelType;
//zcj 2018-10-30import com.changhong.android.tvapi.common.vo.PanelInfo;
//import com.changhong.tvos.common.MiscManager;
//import com.changhong.tvos.common.PictureManager;
//import com.changhong.tvos.common.TVManager;
//import com.changhong.tvos.common.exception.IllegalValueException;
//import com.changhong.tvos.model.ChOsType.EnumPanelType;
//import com.changhong.tvos.model.PanelInfo;
//zcj 2018-10-30 import com.changhong.tvos.service.TvMiscManager;

//page 9
public class factoryPage9{
//	private static MiscManager miscManager;
	//zcj 2018-10-30 private TvMiscManager mTvMiscManager = null;
//	PictureManager mPictureManager;
	static factoryPage9 Interface =null;
	MenuConfigManager mCfg =MenuConfigManager.getInstance(null);
    int mData[] =null;
	private factoryPage9(Context context){
//		TVManager tvManager = TVManager.getInstance(context);
		try {
//			miscManager = tvManager.getMiscManager();
//			mPictureManager =tvManager.getPictureManager();
 //zcj 2018-10-30 mTvMiscManager =TvMiscManager.getInstance();
		} catch (Exception e) {
			// TODO: handle exception
			Log.v("tv","miscManager ==null");
		}
	} 
	
	public static factoryPage9 getInstance(Context context){
		if(Interface ==null){
			Interface = new factoryPage9(context);
		}
		return Interface;
	}
	public Boolean setEnergyEfficiency(){
		
		return false;
	}

	public int getProcPeroid() {
		// TODO Auto-generated method stub
		return getData(0);
	}
	
	public int getDarkEnhenceDownSpeed() {
		// TODO Auto-generated method stub
		return getData(1);
	}
	public int getPresetMidPointApl() {
		// TODO Auto-generated method stub
		return getData(2);
	}
	
	public int getPresetMidPointPwm() {
		// TODO Auto-generated method stub
		return getData(3);
	}
	
	public int getLmax() {
		// TODO Auto-generated method stub
		return getData(4);
	}
	public int getLDarkSence() {
		// TODO Auto-generated method stub
		return getData(5);
	}
	public int getSampleTimes() {
		// TODO Auto-generated method stub
		return getData(6);
	}
	public int getCutPointApl() {
		// TODO Auto-generated method stub
		return getData(7);
	}
	public int getLowPointApl() {
		// TODO Auto-generated method stub
		return getData(8);
	}

	public int getHighPointApl() {
		// TODO Auto-generated method stub
		return getData(9);
	}

	public int getCutPointPwm() {
		// TODO Auto-generated method stub
		return getData(10);
	}

	public int getLowPointPwm() {
		// TODO Auto-generated method stub
		return getData(11);
	}

	public int getHighPointPwm() {
		// TODO Auto-generated method stub
		return getData(12);
	}

	public int getBigStepDiff() {
		// TODO Auto-generated method stub
		return getData(13);
	}
	public int getMidStepDiff() {
		// TODO Auto-generated method stub
		return getData(14);
	}
	public int getSmallStepDiff() {
		// TODO Auto-generated method stub
		return getData(15);
	}
	public int getBigStepVal() {
		// TODO Auto-generated method stub
		return getData(16);
	}
	public int getMidStepVal() {
		// TODO Auto-generated method stub
		return getData(17);
	}
	public int getSmallStepVal() {
		// TODO Auto-generated method stub
		
		return getData(18);
	}
	
	public int getDCCEnable() {
		// TODO Auto-generated method stub
		return getData(19);
	}
	
	public int getDCCZeroPonit() {
		// TODO Auto-generated method stub
		return getData(20);
	}
	
	public int getGammaCompensateMode() {
		// TODO Auto-generated method stub
		return getData(21);
	}
	public void setProcPeroid(int index,int value) {
		// TODO Auto-generated method stub
		setData(index,value);
	}
	public void setDarkEnhenceDownSpeed(int index, int value) {
		// TODO Auto-generated method stub
		setData(index,value);
	}

	public void setPresetMidPointApl(int index, int value) {
		// TODO Auto-generated method stub
		setData(index,value);
	}


	public void setPresetMidPointPwm(int index, int value) {
		// TODO Auto-generated method stub
		setData(index,value);
	}
	public void setLmax(int index,int value) {
		// TODO Auto-generated method stub
		setData(index,value);
	}

	public void setLumaHistWeight(int index,int value) {
		// TODO Auto-generated method stub
		setData(index,value);
	}

	public void setSampleTimes(int index,int value) {
		// TODO Auto-generated method stub
		setData(index,value);
	}

	public void setLowPointApl(int index,int value) {
		// TODO Auto-generated method stub
		setData(index,value);
	}

	public void setHighPointApl(int index,int value) {
		// TODO Auto-generated method stub
		setData(index,value);
	}

	public void setLowPointPwm(int index,int value) {
		// TODO Auto-generated method stub
		setData(index,value);
	}

	public void setHighPointPwm(int index,int value) {
		// TODO Auto-generated method stub
		setData(index,value);
	}

	public void setBigStepDiff(int index,int value) {
		// TODO Auto-generated method stub
		setData(index,value);
	}

	public void setMidStepDiff(int index,int value) {
		// TODO Auto-generated method stub
		setData(index,value);
	}

	public void setSmallStepDiff(int index,int value) {
		// TODO Auto-generated method stub
		setData(index,value);
	}
	
	public void setBigStepVal(int index,int value) {
		// TODO Auto-generated method stub
		setData(index,value);
	}

	public void setMidStepVal(int index,int value) {
		// TODO Auto-generated method stub
		setData(index,value);
	}

	public void setSmallStepVal(int index, int value) {
		// TODO Auto-generated method stub
		setData(index,value);
	}
	public void initPage9Data(){
		Log.v("tv","getDriverOperate CHTV_MW_CUST_SPEC_GET_DBL_PARAMETER");
//		mData =miscManager.getDriverOperate(ENUMDriverOperate.CHTV_MW_CUST_SPEC_GET_DBL_PARAMETER.ordinal(), 17+5);

		//zcj 2018-10-30 mData =mTvMiscManager.getPanelDBLParavalue(22);
	}
	private void setData(int index ,int value){
		int[] data ={index,value};
		Log.v("tv","index ="+index);
		Log.v("tv","value ="+value);
//		if(miscManager !=null){
//			miscManager.setDriverOperate(ENUMDriverOperate.CHTV_MW_CUST_SPEC_SET_DBL_PARAMETER.ordinal(), 2, data);
//		}
		//zcj 2018-10-30 mTvMiscManager.setPanelDBLParavalue(index, value);
	}
	private int getData(int index){
		if(mData !=null && mData.length >index){
			Log.v("tv","mData["+index+"]" +mData[index]);
			return mData[index];
		}else {
			return 0;
		}
	}
	public void setDCCEnable(int index, int value) {
		// TODO Auto-generated method stub
		setData(index,value);
	}

	public void setDCCZeroPonit(int index, int value) {
		// TODO Auto-generated method stub
		setData(index,value);
	}
	public void setGammaCompensateMode(int i, int value) {
		// TODO Auto-generated method stub
		setData(i,value);
	}

	public void setCutPointPwm(int i, int value) {
		// TODO Auto-generated method stub
		setData(i,value);
	}

	public void setCutPointApl(int i, int value) {
		// TODO Auto-generated method stub
		setData(i,value);
	}

	public int getPQOnOff() {
		// TODO Auto-generated method stub
		/*if(mTvMiscManager.getPQAdjust()){
			return 1;
		}*/
		return 0;
	}

	public void setPQOnOff(int value) {
		// TODO Auto-generated method stub
		//zcj 2018-10-30 mTvMiscManager.setPQAdjust(value ==1);
	}

	public int getGammaIndex() {
		// TODO Auto-generated method stub
		//zcj 2018-10-30 return mTvMiscManager.getGammaIndex();
		return 0;
	}

	public void setGammaIndex(int value) {
		// TODO Auto-generated method stub
		//zcj 2018-10-30 mTvMiscManager.setGammaIndex(value);
	}

	public boolean isPDP() {
		// TODO Auto-generated method stub
		/*//zcj 2018-10-30PanelInfo mPanelInfo = mTvMiscManager.getPanelInfo(null);
		EnumPanelType mPanelType = mPanelInfo.mePanelType;
		return mPanelType.equals(EnumPanelType.PANEL_PDP);*/
		return false;
	}

	public int getRedGain() {
		// TODO Auto-generated method stub
		try {
			//zcj 2018-10-30 return mTvMiscManager.getRGAIN();
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return 0;
	}

	public void setRedGain(int value) {
		// TODO Auto-generated method stub
		try {
			//zcj 2018-10-30 mTvMiscManager.setBGAIN(value);
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}

	public int getRedOffset() {
		// TODO Auto-generated method stub
		try {
//			return mTvMiscManager.getRedOffset();
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return 0;
	}

	public void setRedOffset(int value) {
		// TODO Auto-generated method stub
		try {
//			mTvMiscManager.setRedOffset(value);
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}

	public int getGreenGain() {
		// TODO Auto-generated method stub
		try {
			//zcj 2018-10-30 return mTvMiscManager.getGGAIN();
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return 0;
	}

	public void setGreenGain(int value) {
		// TODO Auto-generated method stub
		try {
			//zcj 2018-10-30mTvMiscManager.setGGAIN(value);
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}

	public int getGreenOffset() {
		// TODO Auto-generated method stub
		try {
//			return mTvMiscManager.getGreenOffset();
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return 0;
	}

	public void setGreenOffset(int value) {
		// TODO Auto-generated method stub
		try {
	//		mTvMiscManager.setGreenOffset(value);
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}

	public int getBlueGain() {
		// TODO Auto-generated method stub
		try {
			//zcj 2018-10-30 return mTvMiscManager.getBGAIN();
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return 0;
	}

	public void setBlueGain(int value) {
		// TODO Auto-generated method stub
		try {
			//zcj 2018-10-30 mTvMiscManager.setBGAIN(value);
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}

	public void setBlueOffset(int value) {
		// TODO Auto-generated method stub
		try {
//			mTvMiscManager.setBlueOffset(value);
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}

	public int getBlueOffset() {
		// TODO Auto-generated method stub
		try {
//			return mTvMiscManager.getBlueOffset();
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return 0;
	}
	
}